

namespace NodeBasedSkillEditor.Model.Node.RT
{
    public class Node_Not_RT : RT_Node
    {
        public RT_SingleValuePort Value_RT;

        public RT_SingleValuePort Result_RT;

        public Node_Not_RT(Node_Not sourceData, RT_DAG parentDag) : base(sourceData, parentDag)
        {
            Value_RT = new RT_SingleValuePort(EPortIOType.Input, sourceData.Value, this);

            Result_RT = new RT_SingleValuePort(EPortIOType.Output, sourceData.Result, this);
            Result_RT.OnGetValue = GetResult;
        }

        public AValue GetResult(DAG_Executor executor)
        {
            bool value = Value_RT.GetValue(executor).ToBoolean().Item2;
            bool result = !value;
            Result_RT.SourceValue.SetBoolean(result);
            return Result_RT.SourceValue;
        }
    }
}